package com.ms.teapuesto.util;

/**
 * Created by RAZANERO on 26/08/14.
 */

import com.gargoylesoftware.htmlunit.html.*;
import org.apache.poi.ss.usermodel.Cell;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Iterator;

/**
 * User: gmc
 * Date: 07/09/2010
 */
public class ExcelUtil {

    public static void setCellValue(Cell cell, Object obj) throws Exception {
        if (obj instanceof String)
            cell.setCellValue((String) obj);
        else if (obj instanceof BigDecimal)
            cell.setCellValue(new Double(obj + ""));
        else if (obj instanceof Double)
            cell.setCellValue(new Double(obj + ""));
        else if (obj instanceof Integer)
            cell.setCellValue((Integer) obj);
        else if (obj instanceof Long)
            cell.setCellValue(obj + "");
        else if (obj instanceof Date)
            cell.setCellValue((Date) obj);
        else
            cell.setCellValue("");
    }
}

